package main

import (
	"fmt"
)

type test struct {
	Name string
	Age  int
}

func fmy(t test) {
	t.Name = "t1"
	t.Age = 1
}
func fmy1(t *test) {
	t.Name = "t1"
	t.Age = 1
}
func (t test) fmy2() {
	t.Name = "t2"
	t.Age = 2
}
func (t *test) fmy3() {
	t.Name = "t2"
	t.Age = 2
}
func main() {
	var t = test{
		Name: "name",
		Age:  10,
	}
	fmy(t)
	fmt.Println(t) //{name 10}
	fmy1(&t)
	fmt.Println(t) //{t1 1}
	t.fmy2()
	fmt.Println(t) //{t1 1}
	t.fmy3()
	fmt.Println(t) //{t2 2}
}
